#include <stdio.h>
#define ROWS 3
#define COLS 4

int sum(int arr[ROWS][COLS], int row, int col);

int main(void)
{
  int junk[ROWS][COLS] = {
      {2,4,6,8},
      {3,5,7,9},
      {12,10,8,6}
  };
  int total = sum(junk, ROWS, COLS);
  printf("%d\n", total);
  return 0;
}     

int sum(int arr[ROWS][COLS], int row, int col) {
  int i;
  int total = 0;
  for (i=0; i < row; i++) {
    int tot = 0;
    for (int j = 0; j < col; j++) tot += arr[i][j];
    printf("%d\n", tot);
    total += tot;
  }
  return total;
}